package com.example.martian.controller;


import com.example.martian.service.AutnenticationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

@RestController
@RequestMapping("/Autnentication/")
@CrossOrigin
public class AutnenticationController {

    @Autowired
    private AutnenticationService autnenticationService;

    @RequestMapping(value="picUpOCR",method={RequestMethod.POST})
    @ResponseBody
    public Object picUpOCR(@RequestParam("picOcr") MultipartFile picOcr, Integer userId, String username, String idNumber, @RequestParam("picRear")MultipartFile picRear) throws IOException {
        return autnenticationService.picUpOCR(picOcr, userId, username, idNumber,picRear);
    }

    @RequestMapping(value = "selectAuthenticationZt")
    @ResponseBody
    public Object selectAuthenticationZt(Integer userId){
        return autnenticationService.selectAuthenticationZt(userId);
    }
}
